package com.kolakcc.loljclient.view;

import java.awt.BorderLayout;
import java.awt.GridLayout;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JPasswordField;
import javax.swing.JScrollPane;
import javax.swing.JTable;
import javax.swing.JTextField;

import com.kolakcc.loljclient.model.swing.LoLNewsTableModel;

public class LoginView extends KolaView {
	public JTextField usernameField;
	public JPasswordField passwordField;
	public JButton loginButton;
	public JComboBox<String> regionField;
	public JTable newsList;
	public JLabel statusLabel;

	LoLNewsTableModel newsModel;

	public LoginView() {
		this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		this.setTitle("loljclient");
		this.setSize(400,600);
		
		this.newsList = new JTable();
		JScrollPane newsScrollPanel = new JScrollPane(this.newsList);
		this.add(newsScrollPanel, BorderLayout.CENTER);
		
		JPanel bottomPanel = new JPanel(new BorderLayout());
		JPanel formPanel = new JPanel(new GridLayout(3, 2));

		formPanel.add(new JLabel("Region:"));
		this.regionField = new JComboBox<String>();
		formPanel.add(this.regionField);

		formPanel.add(new JLabel("Username:"));
		this.usernameField = new JTextField(20);
		formPanel.add(this.usernameField);

		formPanel.add(new JLabel("Password:"));
		this.passwordField = new JPasswordField(20);
		formPanel.add(this.passwordField);
		bottomPanel.add(formPanel, BorderLayout.NORTH);

		this.loginButton = new JButton("Login");
		bottomPanel.add(this.loginButton, BorderLayout.SOUTH);
		
		this.add(bottomPanel,BorderLayout.SOUTH);

		this.setVisible(true);
	}
}
